<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>发布试卷</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/TeacherAll.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
</head>
<body>
  <div  class="UpLoadDiv">
    <c:if test="${bhTopList!=null&&flagUlCase==1}">
      <script>
        window.location="/BhSyCase/UserBhSy/openWeb?findU=UpLoadCaseTopic.jsp";
      </script>
    </c:if>
    <h1 class="UpLoadTopBtn">试卷编辑</h1>
    <form action="/BhSyCase/BhSyDao/Teacher/upCaseMes" method="post">
      <div class="CaseMesDiv" id="caseMesDivTop" style="display: block">
        <p class="UpCaseFont01">试卷名称 :</p>
        <input class="cName" type="text" name="cName">
        <p class="UpCaseSel01">完成答题是否查看成绩:</p>
        <select class="cFlag" name="flag">
          <option>是</option>
          <option>否</option>
        </select>
        <p class="UpCaseDataFont">考试时间:</p>
        <input class="caseDataPut01" type="text" name="beginTime">
        <input type="button" class="DataBtn01">
        <span class="Dataspan">--</span>
        <input class="caseDataPut02" type="text" name="endTime">
        <input type="button" class="DataBtn02">
      </div>
      <button class="UpLoadBtn" id="uploadBtn">下一步</button>
    </form>
    <div class="site-demo-laydate01">
      <div class="layui-inline" style="display: none" id="test-n1"></div>
      <div class="layui-inline" style="display: none" id="test-n2"></div>
    </div>
    <div class="site-demo-laydate02">
      <div class="layui-inline" style="display: none" id="test-n3"></div>
      <div class="layui-inline" style="display: none" id="test-n4"></div>
    </div>

  </div>

</body>
<script src="${pageContext.request.contextPath}/layui/layui.js"></script>
<script>
  window.onload = function (){
    var testn1 = document.getElementById("test-n1");
    var testn2 = document.getElementById("test-n2");
    var testn3 = document.getElementById("test-n3");
    var testn4 = document.getElementById("test-n4");
    var caseDataPut01 = document.getElementsByClassName("caseDataPut01");
    var caseDataPut02 = document.getElementsByClassName("caseDataPut02");
    var dataTimeS01 ="";
    var dataTimes02 ="";
    var minTime="";
    layui.use('laydate', function() {
      var laydate = layui.laydate;
      //直接嵌套显示
      laydate.render({
        elem: '#test-n1'
        ,position: 'static'
        ,min: '2021-1-1'
        ,max: '2022-12-31'
        ,done: function(value, date, endDate){
          minTime+=value;
          testn1.style.display="none";
          testn2.style.display="block";
          dataTimeS01="";
          dataTimeS01+=value+" ";
        }

      });
      laydate.render({
        elem: '#test-n2'
        ,type: 'time'
        ,position: 'static'
        ,done:function (value){
          testn2.style.display="none";
          dataTimeS01+=value;
          caseDataPut01[0].value=dataTimeS01;
          dataTimeS01="";
        }
      });


      //直接嵌套显示
      laydate.render({
        elem: '#test-n3'
        ,position: 'static'
        ,min: minTime
        ,max: '2029-8-9'
        ,done: function(value, date, endDate){
          testn3.style.display="none";
          testn4.style.display="block";
          dataTimeS02="";
          dataTimes02=""
          dataTimes02+=value+" ";
        }

      });
      laydate.render({
        elem: '#test-n4'
        ,type: 'time'
        ,position: 'static'
        ,done:function (value){
          testn4.style.display="none";
          dataTimes02+=value;
          caseDataPut02[0].value=dataTimes02 ;
          dataTimes02="";
        }
      });

    });
    var dataBtn01 = document.getElementsByClassName("DataBtn01");
    var dataBtn02 = document.getElementsByClassName("DataBtn02");
    let btnCNum01 = 1;
    let btnCNum02 = 1;
    dataBtn01[0].onclick = function (){
          if (btnCNum01==1){
            testn1.style.display="block";
            btnCNum01++;
          }else {
            testn1.style.display="none";
            testn2.style.display="none";
            btnCNum01=1;
          }

    }
    dataBtn02[0].onclick = function (){
      if (btnCNum02==1){
        testn3.style.display="block";
        btnCNum02++;
      }else {
        testn3.style.display="none";
        testn4.style.display="none";
        btnCNum02=1;
      }

    }
  }
</script>
</html>